// pages/sport/index/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    isScrolX:true,
    isDown:false,
    // 轮播图片
    imagList:[
      '../../../images/sport/basketball.jpg',
      '../../../images/sport/climb.jpg',
      '../../../images/sport/gym.jpg',
      '../../../images/sport/run.jpg',
    ],
    suggest_text:'运动建议',
    suggestList:[
      {icon:'../../../images/sport/run_icon.png',text:'跑步',url:'../../sport/run_suggest/index'},
      {icon:'../../../images/sport/basketball_icon.png',text:'篮球',url:'../../sport/basketball_suggest/index'},
      {icon:'../../../images/sport/chinUp_icon.png',text:'引体向上',url:'../../sport/pull_up_suggest/index'},
      {icon:'../../../images/sport/pushUp_icon.png',text:'俯卧撑',url:'../../sport/push_up_suggest/index'},
    ],
    // 功能列表
    action_list:[
      {icon:'../../../images/sport/today_sport_icon.png',text:'当天运动',url:'../today_sport/index'},
      {icon:'../../../images/sport/find_icon.png',text:'查询',url:'../find/index'},
      {icon:'../../../images/sport/record_icon.png',text:'记录',url:'../record/index'},
      {icon:'../../../images/sport/set_icon.png',text:'设置',url:'../setup/sumit_page/index'},
    ],

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var value = wx.getStorageSync('hasLogin')
    if(value=='' || value==false ){
      wx.redirectTo({
        url: '/pages/login/index',
        success:function(e){
            console.log("成功跳转到登录界面")
        },
        fail:function(error){
          console.log("跳转失败--app.js")
        }
      })
    }
  },
  onShow(){
   
  }

})